export default {
  computed: {
    colWidth() {
      // 先匹配宽度
      if (this.$attrs.width) {
        return this.$attrs.width
      }
      // 再根据具体字段匹配宽度
      switch (this.$attrs.ctype) {
        case 'selection':
          return '40'
        case 'index':
          return '58'
        case 'orderNo':
          return '120'
        case 'phone-2f':
          return '112'
        case 'datetime':
          switch (this.$attrs.w) {
            case '1f':
              return '128'
          }
          return '128'
          break
        case 'address':
        case 'address-2f':
          return '150'
        case 'vin':
        case 'vin-2f':
          return '160'
        case 'remark':
          return '300'
      }
      // 最后再进行宽度类型匹配  ex: '3c2f'表示3个汉字加两个图标的宽度
      switch (this.$attrs.w) {
        case '2c1f':
          return '74'
        case '2c2f':
          return '86'
        case '3c2f':
          return '100'
        case '3c':
          return '58'
        case '4c':
          return '74'
        case '4c1f':
          return '100'
        case '4c2f':
          return '112'
        case '5c':
          return '86'
        case '5c1f':
          return '110'
        case '5c2f':
          return '124'
        case '6c':
          return '100'
        case '7c1f':
          return '134'
        case '9c1f':
          return '150'
        // 字段默认宽度
        default:
          return '120'
      }
    }
  }
}